import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
import dict from './modules/dict'
import user from './modules/user'
import tagsView from './modules/tagsView'
import permission from './modules/permission'
import settings from './modules/settings'
import getters from './getters'
import step from './modules/step'
// import createPersistedState from "vuex-persistedstate";
Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    app,
    dict,
    user,
    tagsView,
    permission,
    settings,
    step
  },
  // plugins: [
  //   createPersistedState({
  //     // 存储方式：localStorage、sessionStorage、cookies
  //     storage: window.sessionStorage,
  //     // 存储的 key 的key值
  //     key: "store",
  //     reducer(state) { //render错误修改
  //       // 要存储的数据：本项目采用es6扩展运算符的方式存储了state中所有的数据
  //       return { ...state };
  //     }
  //   })
  // ],
  getters
})

export default store
